package com.example.happiness.controller;

import com.example.happiness.pojo.Chat;
import com.example.happiness.result.Result;
import com.example.happiness.service.general.ChatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/chat")
@Api(value = "聊天记录")
public class ChatController {

    @Autowired
    ChatService chatService;

    @PostMapping("/add")
    @ApiOperation(value = "添加聊天记录")
    public Result addChat(@RequestBody Chat chat){
        chatService.addChat(chat);
        return Result.success();
    }
}
